package com.wkbb.basic.feign;

import com.wkbb.common.constants.VersionConstant;
import com.wkbb.common.dto.ResultDTO;
import com.wkbb.common.dto.door.DoorDeviceLogsDto;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "wkbb-door-service")
public interface DoorFeignService {

    @ApiOperation(value = "新增设备日志记录")
    @RequestMapping(value = "/door/v1/access/hardware/addDeviceLogs", method = RequestMethod.POST)
    ResultDTO addDeviceLogs(@RequestBody DoorDeviceLogsDto doorDeviceLogs);

    @ApiOperation(value = "同步用户信息到设备")
    @RequestMapping(value = "/door/v1/access/open/synUserToDoor", method = RequestMethod.POST)
    ResultDTO synUserToDoor(
        @ApiParam(value = "学校ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
        @ApiParam(value = "用户ID", required = true) @RequestParam(name = "userId", required = true) Long userId,
        @ApiParam(value = "用户类型(1教师 2家长 3学生)", required = false) @RequestParam(name = "userType", required = false) Integer userType,
        @ApiParam(value = "是否删除 1是 0否", required = false) @RequestParam(name = "isDel", required = false) Integer isDel
    );

    @ApiOperation(value = "初始化校门场景数据")
    @RequestMapping(value = "/door/v1/access/open/initSchoolGaleData", method = RequestMethod.POST)
    ResultDTO initSchoolGaleData(
        @ApiParam(value = "学校ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId
    );

    @ApiOperation(value = "同步班级信息到门禁系统")
    @RequestMapping(value = "/door/v1/access/open/synClassToDoor", method = RequestMethod.POST)
    ResultDTO synClassToDoor(
        @ApiParam(value = "学校ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
        @ApiParam(value = "班级ID", required = true) @RequestParam(name = "classId", required = true) Long classId
    );

    @ApiOperation(value = "同步设备信息到门禁系统")
    @RequestMapping(value = "/door/v1/access/open/synDeviceToDoor", method = RequestMethod.POST)
    ResultDTO synDeviceToDoor(
        @ApiParam(value = "学校ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
        @ApiParam(value = "原设备号", required = true) @RequestParam(name = "oriDeviceCode", required = true) String oriDeviceCode,
        @ApiParam(value = "新设备号", required = true) @RequestParam(name = "newDeviceCode", required = true) String newDeviceCode,
        @ApiParam(value = "设备名称", required = true) @RequestParam(name = "deviceName", required = true) String deviceName,
        @ApiParam(value = "设备版本号", required = true) @RequestParam(name = "deviceVersion", required = true) String deviceVersion,
        @ApiParam(value = "场景1：校门 2：宿舍楼 3：办公楼 4：教学楼 5：校车", required = true) @RequestParam(name = "scene", required = true)Short scene,
        @ApiParam(value = "是否删除", required = true) @RequestParam(name = "isDel", required = true) boolean isDel
    );

    @ApiOperation(value = "同步角色")
    @RequestMapping(value = "/door/v1/access/role/synRoleTress", method = RequestMethod.GET)
    public ResultDTO synRoleTress(@ApiParam(value = "学校ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId);

    @ApiOperation(value = "调班升班")
    @RequestMapping(value = "/door/v1/access/open/syncChangeClassData", method = RequestMethod.POST)
    public ResultDTO syncChangeClassData(
            @ApiParam(value = "操作类型", required = true) @RequestParam(name = "operateType", required = true) Integer operateType,
            @ApiParam(value = "学校ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
            @ApiParam(value = "年级ID", required = true) @RequestParam(name = "gradeId", required = true) Long gradeId,
            @ApiParam(value = "年级名称", required = true) @RequestParam(name = "gradeName", required = true) String gradeName,
            @ApiParam(value = "班级ID", required = true) @RequestParam(name = "classId", required = true) Long classId,
            @ApiParam(value = "班级名称", required = true) @RequestParam(name = "className", required = true) String className,
            @ApiParam(value = "用户ID", required = true) @RequestParam(name = "userId", required = true) Long userId,
            @ApiParam(value = "操作用户", required = true) @RequestParam(name = "operateUser", required = true) String operateUser
    );

    /**
     * 注册人脸
     */
    @ApiOperation(value = "注册人脸")
    @RequestMapping(value = "/door/v1/faceRecognition/open/faceRegist", method = RequestMethod.POST)
    public ResultDTO<Object> faceRegist(
            @ApiParam(value = "picBase64", required = false) @RequestParam(name = "picBase64", required = false) String picBase64,
            @ApiParam(value = "picUrl", required = false) @RequestParam(name = "picUrl", required = false) String picUrl,
            @ApiParam(value = "personId", required = true) @RequestParam(name = "personId", required = true) String personId,
            @ApiParam(value = "extendGroupId", required = false) @RequestParam(name = "extendGroupId", required = false) String extendGroupId,
            @ApiParam(value = "groupId", required = false) @RequestParam(name = "groupId", required = false) String groupId);
    /**
     * 批量注册人脸
     */
    @ApiOperation(value = "批量注册人脸")
    @RequestMapping(value = "/door/v1/faceRecognition/open/batchFaceRegist", method = RequestMethod.POST)
    public ResultDTO<Object> batchFaceRegist(
            @ApiParam(value = "picBase64", required = false) @RequestParam(name = "picBase64", required = false) String picBase64,
            @ApiParam(value = "picUrl", required = false) @RequestParam(name = "picUrl", required = false) String picUrl,
            @ApiParam(value = "personId", required = true) @RequestParam(name = "personId", required = true) String personId,
            @ApiParam(value = "extendGroupId", required = false) @RequestParam(name = "extendGroupId", required = false) String extendGroupId,
            @ApiParam(value = "groupId", required = false) @RequestParam(name = "groupId", required = false) String groupId);
    /**
     * 注销/删除人脸
     */
    @ApiOperation(value = "注销/删除人脸")
    @RequestMapping(value = "/door/v1/faceRecognition/open/deleteFace", method = RequestMethod.DELETE)
    public ResultDTO<Object> deleteFace(
            @ApiParam(value = "personId", required = true) @RequestParam(name = "personId", required = true) String personId,
            @ApiParam(value = "extendGroupId", required = false) @RequestParam(name = "extendGroupId", required = false) String extendGroupId,
            @ApiParam(value = "groupId", required = false) @RequestParam(name = "groupId", required = false) String groupId);
}
